package com.dysm.loan;

import java.math.BigDecimal;

/**
 * 利息计算
 * @author xiay
 * @since 2020/9/22 3:52 下午
 */
public class InterestCalculateTest {

    public static void main(String[] args) {
        BigDecimal totalAmount = BigDecimal.valueOf(700000);

        BigDecimal monthNum = BigDecimal.valueOf(312);

        BigDecimal yearRate = BigDecimal.valueOf(0.0310);
        // 4204.95 - 2453.28 = 1751.67   45842 / 1752 = 26 个月
        // 4204.95 - 3200 = 1005   45842 / 1005 = 45 个月

        //3270 + 1580 = 4850
//        InterestCalculate standOfCapitalCal  = new StandOfCapitalCal();
//        standOfCapitalCal.calculate(totalAmount, monthNum, yearRate);

        StandOfInterestCal standOfInterestCal = new StandOfInterestCal();
        standOfInterestCal.calculate(totalAmount, monthNum, yearRate);

    }

}
